
import DAL.CarManeger;
import DataCar.Car;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Pasha
 */
public class MainClass {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int count = 0, tmp;
        boolean cheak = false;
        String nameCar = "Default";
        Scanner sc = new Scanner(System.in);
        Scanner sc2 = new Scanner(System.in);
        Scanner sc3 = new Scanner(System.in);
        CarManeger cm = new CarManeger();
        
        System.out.print("Input count cars: ");
        count = sc.nextInt();
        
        List<Car> cars = new ArrayList<Car>(); 
        for(int i = 0; i < count; i++)
        {
            tmp = i + 1;
            System.out.print(String.format("Input name car " + tmp +": "));
            nameCar = sc2.nextLine();
            cars.add(new Car(nameCar));
        }
        
        System.out.print("Input (true/false) for start race: ");
        cheak = sc3.nextBoolean();
        if(cheak)
        {
            System.out.print("Start race\n");
            cm.Race(cars);
            System.out.print("Finish race\n");
        }
        else
        {
            System.out.print("Race not started!\n");
        }
        
        
    }
    
}

